package com.YHVision.qiuzhike.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.YHVision.qiuzhike.model.dto.userCompany.UserCompanyQueryRequest;
import com.YHVision.qiuzhike.model.entity.UserCompany;
import com.YHVision.qiuzhike.model.vo.UserCompanyVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 用户企业关联服务
 *
 * @author <a href="">YHVision-小y</a>
 * @from <a href="todo">爱编程学习圈</a>
 */
public interface UserCompanyService extends IService<UserCompany> {

    /**
     * 校验数据
     *
     * @param userCompany
     * @param add 对创建的数据进行校验
     */
    void validUserCompany(UserCompany userCompany, boolean add);

    /**
     * 获取查询条件
     *
     * @param userCompanyQueryRequest
     * @return
     */
    QueryWrapper<UserCompany> getQueryWrapper(UserCompanyQueryRequest userCompanyQueryRequest);
    
    /**
     * 获取用户企业关联封装
     *
     * @param userCompany
     * @param request
     * @return
     */
    UserCompanyVO getUserCompanyVO(UserCompany userCompany, HttpServletRequest request);

    /**
     * 分页获取用户企业关联封装
     *
     * @param userCompanyPage
     * @param request
     * @return
     */
    Page<UserCompanyVO> getUserCompanyVOPage(Page<UserCompany> userCompanyPage, HttpServletRequest request);
}
